<template>
  <div>
    为 <b> {{ cinemaRoom.cinema_name }} </b> 的
    <b>{{ cinemaRoom.cinema_room_name }} </b> 号厅添加排片计划
    <el-divider></el-divider>
    <el-table :data="plans" style="width: 100%">
      <el-table-column prop="title" label="电影名称" width="180"> </el-table-column>
      <el-table-column prop="showingon_date" label="放映时间" width="180"> </el-table-column>
      <el-table-column prop="showingon_time" label="场次"> </el-table-column>
      <el-table-column label="票价" prop="price"></el-table-column>
      <el-table-column label="是否已发布" >
        <template slot-scope="scope">
            <el-switch v-model="scope.row.status" active-color="#13ce66" inactive-color="#ccc"
            :active-value="1" :inactive-value="0"></el-switch>
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <el-button type="danger" size="small" icon="el-icon-delete" circle></el-button>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      cinemaRoom: {}, //当前放映厅对象信息
      movieList: [], //请求到的可选的电影列表
        plans:[]
    };
  },
  mounted() {
    // 加载放映厅的信息 : 哪个影院 哪个厅
    let params = { id: this.$route.params.room_id };
    this.$http.cinemaRoomApi.queryById(params).then((res) => {
      console.log("加载基本放映厅的信息", res);
      this.cinemaRoom = res.data.data;
    });
    let param={room_id:this.$route.params.room_id}
    this.$http.showingonPlanApi.queryByRoomId(param).then(res=>{
        console.log('当前放映厅的排片计划',res);
        this.plans=res.data.data
    })
  },
};
</script>

<style lang="scss" scoped></style>
